﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using LayuiDemo.Models;


namespace LayuiDemo.tms.ViewModels.DriverTruckVMs
{
    public partial class DriverTruckTemplateVM : BaseTemplateVM
    {
        public ExcelPropety Driver_Excel = ExcelPropety.CreateProperty<DriverTruck>(x => x.DriverId);
        public ExcelPropety Truck_Excel = ExcelPropety.CreateProperty<DriverTruck>(x => x.TruckId);

	    protected override void InitVM()
        {
            Driver_Excel.DataType = ColumnDataType.ComboBox;
            Driver_Excel.ListItems = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
            Truck_Excel.DataType = ColumnDataType.ComboBox;
            Truck_Excel.ListItems = DC.Set<Truck>().GetSelectListItems(Wtm, y => y.TruckName);
        }

    }

    public class DriverTruckImportVM : BaseImportVM<DriverTruckTemplateVM, DriverTruck>
    {

    }

}
